package com.usermanage.controller;

import com.usermanage.beanParam.GroupCoopBean;
import com.usermanage.util.JsonData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


@Api(description = "合作对象关联接口")
@RestController
@RequestMapping("/groupCoop")
public class GroupCoopController {

    /**
     * 添加组织信息
     * @param bean
     * @param bindingResult
     * @return
     * @throws Exception
     */
    @ApiOperation(value = "添加合作对象关联信息" ,  notes="添加合作对象关联信息")
    @RequestMapping(value="/creatCoop",method= RequestMethod.POST)
    public JsonData creatCoop(@Valid @RequestBody GroupCoopBean bean, BindingResult bindingResult)throws Exception{
        //验证提交参数
        if(bindingResult.hasErrors()){
            return JsonData.fail(bindingResult.getFieldError().getDefaultMessage());
        }

        //验证部门是否存在

        //添加组信息

        return JsonData.success();
    }



}
